@extends('backend/layouts/default')
@section('title')
{{!empty($data['singer']->id) ? "Sửa thông tin ca sĩ":"Thêm ca sĩ mới" }}
@stop
@section('content')
<h3>
    <span
        class="glyphicon glyphicon-pencil"></span> <?= !empty($data['singer']->id) ? "Sửa thông tin ca sĩ" : "Thêm ca sĩ mới"; ?>
</h3>
@if(Session::has('success'))
<h3>
    {{Session::get('success')}}
</h3>
@endif
<form class="form-horizontal" action="{{ route('create/singers/admin') }}" method="post">
    {{ Form::token() }}
    <input type="hidden" value="{{ $data['singer']->id }}" name="data[Singer][id]"/>

    <div class="row">
        <div class="col-md-9">
            <div class="form-group <?= $errors->has('name') ? "error" : "" ?>">
                <label class="control-label col-sm-4">
                    Tên ca sĩ
                </label>

                <div class="col-sm-8">
                    <input class="form-control" name="data[Singer][name]" value="<?= $data['singer']->name ?>"/>
                    <?= $errors->first('name', '<span class="help-inline">:message</span>') ?>
                </div>
            </div>
            <div class="form-group <?= $errors->has('description') ? "error" : "" ?>">
                <label class="control-label col-sm-4">
                    Miêu tả
                </label>

                <div class="col-sm-8">
                    <?= $errors->first('description', '<span class="help-inline">:message</span>') ?>
                    <textarea class="form-control" name="data[Singer][description]"
                              id="textareabox"><?= $data['singer']->description ?></textarea>
                </div>
            </div>
            <div class="controls" align="right">
                <a class="btn btn-link" href="{{ route('singers/admin') }}">Hủy</a>
                <button type="submit" class="btn btn-success btn-sm">Lưu</button>
            </div>
        </div>
    </div>
</form>
@stop